cap log close
snapshot erase _all
clear all
macro drop _all
estimates drop _all

*===========================*
*	Set Globals				*
*===========================*

	local user 2 	// 1 User 1, 2 User 2

	if `user'==1{
		global home "SET USER HOME PATH"
	}
	if `user'==2{
		global home "SET USER HOME PATH"
	}

	global data_path 	"${home}/data"
	global out_path 	"${home}/output"
	global do_path 		"${home}/dofile"	
	global log_path 	"${home}/dofile/smcl"
	
	local run_setup				0
	local run_regs				0
	local run_paper_tables		0
	local run_paper_elements	0
	
*===========================*
*	Run Files				*
*===========================*


	** Setup Files
	
	if `run_setup'==1{
		do "${do_path}/01_gen_CDC.do"
		do "${do_path}/02_gen_ASEC_panel.do"
		do "${do_path}/03_gen_analysis.do"
	}
	
	** Regressions for Coef Plots
	if `run_regs'{
		do "${do_path}/10_main_DDD.do"
		do "${do_path}/11_sub_DDD.do"		// user manually sets subgroups; paper used gender_parents and some_sick 
		do "${do_path}/12_sub2_DDD.do"		// user manually sets subgroups; paper used apr_hi and gender_parents
	}
	
	** Tables in Paper
	if `run_paper_tables'==1{
		do "${do_path}/20_main_tables.do"	
		do "${do_path}/21_appendix_tables.do"	
		do "${do_path}/22_main_tables_wo_public.do"

	}

	** Paper Elements
	if `run_paper_elements'==1{
		do "${do_path}/30_paper_figures.do"	
		do "${do_path}/31_sum_tables.do"	
		do "${do_path}/32_additional_figures.do"	
		
	}
	
	